<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@page pageEncoding="UTF-8" contentType="text/html; UTF-8" isELIgnored="false" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>超市账单管理系统-订单管理</title>
	<link type="text/css" rel="stylesheet" href="../css/style.css">
</head>
<body>
<div class="menu">
	<table>
		<tbody>
		<tr>
			<td>
				<form method="post" action="${pageContext.request.contextPath}/bill/search?target=1">
					<input name="method" value="query" class="input-text" type="hidden"> 客户名称：<input name="customerName" class="input-text" type="text" value="">&nbsp;&nbsp;&nbsp;&nbsp;
					<input value="查 询" type="submit">
				</form>
			</td>

		</tr>
		</tbody>
	</table>
</div>
<div class="main">
	<div class="optitle clearfix">
		<div class="title">订单管理&gt;&gt;</div>
		<em><input value="添加订单" class="input-button" onclick="window.location='${pageContext.request.contextPath}/bill/addview'" type="button">
		</em>
	</div>
	<div class="content">
		<c:if test="${empty requestScope.bills}">
			<div class="empty-tip">暂无订单数据</div>
		</c:if>
		<c:if test="${not empty requestScope.bills}">
			<table class="list">
				<tbody>
				<tr>
					<td width="40" height="23"><div class="STYLE1" align="center">订单编号</div></td>
					<td width="50"><div class="STYLE1" align="center">客户名称</div></td>
					<td width="100"><div class="STYLE1" align="center">订单时间</div></td>
					<%--<td width="50"><div class="STYLE1" align="center">订单状态</div></td>--%>
					<td width="50"><div class="STYLE1" align="center">支付方式</div></td>
					<td width="60"><div class="STYLE1" align="center">总金额</div></td>
					<td width="60"><div class="STYLE1" align="center">操作</div></td>
				</tr>
				<c:forEach items="${requestScope.bills.list}" var="bill">
					<tr>
						<td width="40" height="23"><div>${bill.orderID}</div></td>
						<td width="50"><div>${bill.customerName}</div></td>
						<td width="100"><div>
							<fmt:formatDate value="${bill.orderDate}" pattern="yyyy-MM-dd HH:mm:ss" />
						</div></td>
						<%--<td width="50"><div>${bill.orderStatus}</div></td>--%>
						<td width="50"><div>${bill.paymentMethod}</div></td>
						<td width="60"><div>${bill.totalAmount}</div></td>
						<td width="60"><div>
							<input type="button" value="详情" class="input-button"
								   onclick="window.location='${pageContext.request.contextPath}/bill/showdetail?orderID=${bill.orderID}'">
						</div></td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
			<div style="text-align: right">
				<c:if test="${bills.currentPage>1}">
					<a href="${pageContext.request.contextPath}/bill/getAll?target=1">首页</a>
					<a href="${pageContext.request.contextPath}/bill/getAll?target=${bills.prePage}">上一页</a>
				</c:if>
				<c:if test="${bills.currentPage < bills.totalPageCount}">
					<a href="${pageContext.request.contextPath}/bill/getAll?target=${bills.nextPage}">下一页</a>
					<a href="${pageContext.request.contextPath}/bill/getAll?target=${bills.totalPageCount}">尾页</a>
				</c:if>
				第${bills.currentPage}页/共${bills.totalPageCount}页  共${bills.totalPageCount}条
			</div>
		</c:if>
	</div>
</div>
</body>
</html>